﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCoreLenarn
{
    public class Configs
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Value { get; set; }
    }

    public class ConfigsConfiguration : IEntityTypeConfiguration<Configs>
    {
        public void Configure(EntityTypeBuilder<Configs> builder)
        {
          builder.ToTable("T_Configs");
            builder.Property(c => c.Name).IsRequired().HasMaxLength(100).IsUnicode();
            builder.Property(c => c.Value).IsRequired();
        }
    }
}
